package com.bobo.goods.controller;

import javax.annotation.Resource;

import org.hibernate.validator.constraints.pl.REGON;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.bobo.goods.domain.Goods;
import com.bobo.goods.service.GoodsService;
import com.bobo.goods.vo.GoodsVO;
import com.github.pagehelper.PageInfo;

@Controller
public class GoodsController {
	@Resource
	GoodsService goodsService;
	//列表
	@RequestMapping("list")
	public String list(Model model,GoodsVO goodsVO,@RequestParam(defaultValue = "1") Integer pageNum,@RequestParam(defaultValue = "10") Integer pageSize) {
		PageInfo<Goods> info = goodsService.selects(goodsVO, pageNum, pageSize);
		model.addAttribute("info", info);
		model.addAttribute("goodsVO", goodsVO);
		return "list";
	}

}
